//
//  THSHomeWorktableViewCell.swift
//  SchoolDemo
//
//  Created by rimi on 16/10/11.
//  Copyright © 2016年 YQ. All rights reserved.
//

import UIKit

class THSHomeWorktableViewCell: UITableViewCell {
    //作业题目
    var homeWorkTitleL = UILabel()
    //科目
    var classNameBtn = UIButton()
    //老师名
    var teacherL = UILabel()
    //时间
    var timeL = UILabel()
    //提交圆圈
    var submiView = UIImageView()
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI() {
        //作业题目
        homeWorkTitleL.textColor = UIColor().colorWithHex(0x4c4c4c)
        addSubview(homeWorkTitleL)
        homeWorkTitleL.snp.makeConstraints { (make) in
            make.top.equalTo(16)
            make.left.equalTo(16)
            make.width.equalTo(150)
            make.height.equalTo(30)
        }

        //科目 button圆角与关闭交互
        classNameBtn.layer.cornerRadius = 8
        classNameBtn.setTitleColor(UIColor().colorWithHex(0x009ee7), for: UIControlState.normal)
        classNameBtn.layer.borderWidth = 1
        classNameBtn.layer.borderColor = UIColor().colorWithHex(0x009ee7).cgColor
        classNameBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
        addSubview(classNameBtn)
        
        classNameBtn.isUserInteractionEnabled = false
        classNameBtn.snp.makeConstraints { (make) in
            make.top.equalTo(homeWorkTitleL.snp.bottom).offset(8)
            make.left.equalTo(homeWorkTitleL.snp.left)
            make.width.equalTo(44)
            make.height.equalTo(22)
            
        }

        //老师名
        teacherL.textColor = UIColor().colorWithHex(0x4c4c4c)
        teacherL.font = UIFont.systemFont(ofSize: 15)
        teacherL.textAlignment = .right
        addSubview(teacherL)
        
        teacherL.snp.makeConstraints { (make) in
            make.top.equalTo(16)
            make.left.equalTo(homeWorkTitleL.snp.right).offset(40)
            make.height.equalTo(23)
            make.width.equalTo(80)
        }
  
        //时间
        timeL.textColor = UIColor().colorWithHex(0xcccccc)
        timeL.textAlignment = .center
        timeL.font = UIFont.systemFont(ofSize: 15)
        addSubview(timeL)
        timeL.snp.makeConstraints { (make) in
            make.right.equalTo(teacherL.snp.right)
            make.top.equalTo(teacherL.snp.bottom).offset(16)
            make.bottom.equalTo(classNameBtn.snp.bottom)
            
        }
      
    
        //提交圆圈
        
         addSubview(submiView)
        submiView.snp.makeConstraints { (make) in
            make.top.equalTo(teacherL.snp.top)
            make.left.equalTo(teacherL.snp.right).offset(12)
            make.width.equalTo(65)
            make.height.equalTo(65)
        }
       
    }
    
    
    
}
